<template>
	<view class="">
		<view class="row wiper">
			<view class="item" v-for="(item, index) in picList" :key="index" @tap="previewImage(index)"><image :src="item" mode="" class="item-img" ></image></view>
		</view>
	</view>
</template>

<script>
	export default {
		data(){
			return{
				picList:[]
			}
		},
		onLoad() {
			this.picList=getApp().globalData.pic;
		},
		methods:{
			//预览图片
			previewImage(index) {
				console.log(this.picList);
				const urls = this.picList;
				uni.previewImage({
					current: index,
					urls: urls
				});
			}
		}
	}
</script>

<style scoped lang="scss">
.wiper {
	padding-top: 50upx;
	flex-wrap: wrap;
	width: 560upx;
	margin: 0 auto;
}
.item {
	width: 160upx;
	height: 160upx;
	border-radius: 20upx;
	overflow: hidden;
	margin-right: 40upx;
	margin-bottom: 40upx;
}
.item:nth-child(3n) {
	margin-right: 0;
}
.item-img {
	width: 160upx;
	height: 160upx;
}
</style>
